"""
@File    :   out.py
@Time    :   2024/03/28 19:12:08
@Author  :   Qrj
@Email   :   923207736@qq.com
@description   :   角色相关序列化模型
"""

from datetime import datetime

from pydantic import BaseModel, Field, TypeAdapter

from src.schemas.out import BaseOutSchemaConfigMixin


class RoleCompleteOutSchema(BaseModel, BaseOutSchemaConfigMixin):
    """角色完整的序列化模型"""

    id: int = Field(default=..., description="主键")
    tenant_id: int = Field(default=..., description="租户ID")
    name: str = Field(default=..., description="角色名称")
    status: bool = Field(default=..., description="状态")
    remark: str = Field(default=..., description="备注")
    show_order: int = Field(default=..., description="显示顺序")
    create_datetime: datetime = Field(default=..., description="创建时间")
    update_datetime: datetime = Field(default=..., description="修改时间")
    creator_username: str = Field(default=..., description="创建者用户名")
    updater_username: str = Field(default=..., description="修改者用户名")


# 完整的角色序列化列表模型
ListRoleCompleteOutSchema = TypeAdapter(list[RoleCompleteOutSchema])
